package com.gizwits
import org.json4s._
import org.json4s.jackson.JsonMethods._

import scala.io.Source
import scala.util.{Success, Try}

object json4stest {
  def main(args: Array[String]) {
    implicit val formats = DefaultFormats
  //   url   https://github.com/json4s/json4s
   val path=this.getClass.getResource("/Dita_Airkiss.json").getPath
    println(path)
    val j=Try(Source.fromFile(path).getLines().mkString)
      j  match  {
        case  Success(line) => {
          println(line)
          println(j.get)
          val json=parse(line)
          print(pretty(((json \ "entities") \"attrs")(0) ))
        }
      }

//    val s=j.getLines().mkString
//    println(s)
//
//    val json= parse(s)
//
//    print(pretty(((json \ "entities") \"attrs")(0) ))


  }
}
